<template>
  <div>
     <div class="top-wrapper">
          <div class="titpe">人工智能实训平台</div>
          <el-menu 
          class="menu-wrapper" 
          background-color="#000000" 
          text-color="#fff" 
          active-text-color="#65cea7"  
          router 
          mode="horizontal" 
          :default-active="$route.path">
            <template v-for="(item, index) in menuData">
              <el-menu-item class="menu-item" v-if="!item.children" :index="item.path" :key="index">
                <span slot="title">{{ item.title }}</span>
              </el-menu-item>
              <el-submenu v-else :index="item.path" :key="index">
                <section slot="title">
                  <span slot="title">{{ item.title }}</span>
                </section>
                <el-menu-item class="menu-item" v-for="(sub_item, sub_index) in item.children" :index="sub_item.path" :key="sub_index">
                  <span slot="title" style="margin-left: 12px">{{ sub_item.title }}</span>
                </el-menu-item>
              </el-submenu>
            </template>
          </el-menu>
        </div>
      <div>
        <div class="main-content">
          <router-view></router-view>
        </div>
      </div>
  </div>
</template>


<script>
export default {
  name: 'main',
  components: {
  },
  data() {
      return {
        activeIndex: '1',
        menuData: [
        { path: '/suanfakaifa', title: '算法开发',  },
        { path: '/train', title: '模型训练',},
        { path: '/online',title: '在线服务',},
        { path: '/test1',title: 'test1',},
        // {
        //   path: '/tables',
        //   title: '测试页面3',
        //   children: [
        //     { path: '/dean/AddBanner', title: '二级菜单' },
        //     { path: '/dean/BannerList', title: '二级菜单' }
        //   ]
        // },
      ],
      };
  },
   methods: {
    
   }
}
</script>
<style lang="less">
.top-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  background-color: #000000;
  padding: 0 20px;
  box-sizing: border-box;
  color: #fff;

  .title{
    font-weight: bold;
  }

  .menu-wrapper {
    height: 60px;
    margin-left: 20px;
  }
}
.main-content {
  padding: 20px;
  box-sizing: border-box;
}
</style>